/* **********************************************************************************
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* This source code is subject to terms and conditions of the Shared Source License
* for DSL Editor PowerToy. A copy of the license can be found in the License.htm file
* at the root of this distribution. If you can not locate the Shared Source License
* for DSL Editor PowerToy, please obtain a copy from: http://www.codeplex.com/dsltreegrideditor/Project/License.aspx.
* By using this source code in any fashion, you are agreeing to be bound by
* the terms of the Shared Source License for DSL Editor PowerToy.
*
* You must not remove this notice, or any other, from this software.
*
* **********************************************************************************/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DslEditorPowerToy.Controls
{
    /// <summary>
    /// Describes the runtime attributes of an editor
    /// </summary>
    public class HostedEditor
    {
        private Guid _id;
        private Control _control = null;
        private string _caption = string.Empty;
        private Bitmap _image = null;

        #region Constructors
        public HostedEditor(Guid id, Control control, string caption, Bitmap image)
        {
            this._id = id;
            this._control = control;
            this._caption = caption;
            this._image = image;
        }
        #endregion

        #region Public Properties
        public Guid Id
        {
            get
            {
                return this._id;
            }
        }
        public Control Control
        {
            get
            {
                return this._control;
            }
        }
        public string Caption
        {
            get
            {
                return this._caption;
            }
        }
        public Bitmap Image
        {
            get
            {
                return this._image;
            }
        }
        #endregion

        #region Public Methods
        public override string ToString()
        {
            if (false == string.IsNullOrEmpty(this.Caption))
                return this._caption;
            else
                return base.ToString();

        }
        #endregion
    }
}
